/*--------------------------------------------------------------------------------                                                                            ----       This software is confidential and proprietary and may be used        ----        only as expressly authorized by a licensing agreement from          --date 23/01/2014 --         The entire notice above must be reproduced on all copies.          ----                                                                            ----------------------------------------------------------------------------------/*****************************************************************************/
// 	Description : base type define
//	Global resource dependence : 
//  Author:trongkn
//	Note: 
/*****************************************************************************/#include "fl_typ.h"#define NULL 0typedef unsigned char   u8;typedef signed char     i8;typedef unsigned short  u16;typedef signed short    i16;typedef unsigned int    u32;typedef signed int      i32;u32 EVENT_MAX_DATA =100/*****************************************************************************/
// 	Description : structure FlEvenBuffer
//	Global resource dependence : 
//  Author:trongkn
//	Note: 
/*****************************************************************************/
typedef struct FlSignalBufferTag
{
FlEventType evenTyp;
EvenDta      evenData;
} FlEventBuffer;
   
/*****************************************************************************/
// 	Description : FlEventType
//	Global resource dependence : 
//  Author:trongkn
//	Note: 
/*****************************************************************************/
typedef enum FlEventTypeTag
{
	EVENT_NULL=0,
	EVENT_INTR,
	EVENT_KEY,
	EVENT_UARTDATA,
	EVENT_TIMER,
	EVENT_SERIALSTATUS,
	EVENT_SOCKET,
	EVEN_GPS_DATA,
	EVENT_GPS_NMEA_DATA,
	EVENT_MAX=0XFF
	
}FlEventType;

/*****************************************************************************/
// 	Description : EventData
//	Global resource dependence : 
//  Author:trongkn
//	Note: 
/*****************************************************************************/
typedef union EvenDataTag
{
 	TIMER_EVT    timer_evt;
	KEY_EVT		key_evt;
	UARTDATA_EVT    uartdata_evt;
	INTR_EVT  				intr_evt;
	SERIALSTATUS_EVT    serialstatus_evt;
	SOCKETEVENT_EVT        socket_evt;
	GPSDATA_EVT   				gpsData_evt;
	GPSNMEADATA_EVT			gpsNmeaData_evt;
}EventData;

/*****************************************************************************/
// 	Description : Timer_evt
//	Global resource dependence : 
//  Author:trongkn
//	Note: 
/*****************************************************************************/
typedef struct TIMER_EVTTag{u16		timer_id;u32     interval;}TIMER_EVT;

/*****************************************************************************/
// 	Description : key_evt
//	Global resource dependence : 
//  Author:trongkn
//	Note: 
/*****************************************************************************/
typedef struct KEY_EVTTag{u16		key_val;bool      isPressed;}KEY_EVT;

/*****************************************************************************/
// 	Description : uartdata_evt
//	Global resource dependence : 
//  Author:trongkn
//	Note: 
/*****************************************************************************/
typedef struct UartData_EVTTag{u8		  lenght;u8        data[EVENT_MAX_DATA];FlUartDataType   type;}UARTDATA_EVT;

	typedef  enum UARTDATA_TYPETAG{DATA_SERIAL =0,DATA_DEBUG,UARTDATA_MAX	}FlUartDataType;/*****************************************************************************/
// 	Description : Modem data
//	Global resource dependence : 
//  Author:trongkn
//	Note: 
/*****************************************************************************/typedef struct ModemData_EVTTag{	u8       length;	u8       data[EVENT_MAX_DATA];	FlmodemDataType   type;	u32    atCommandIndex;}MODEMDATA_EVN;typedef enum MODEMDATA_TYPETAG{	    MODEM_CMD =0,		MODEM_DATA,		MODEM_CRWP,		MODEMDATA_MAX,}FlmodemDataType;